<template>
    <div>
        <el-pagination
                class="fy"
                background
                layout="prev, pager, next"
                @current-change="curretChange"
                :page-count="$store.state.pageSum">
        </el-pagination>
    </div>
</template>

<script>
    export default {
        name: "pageInfo",
        props:{
            actionName:{
                type:String,
                default:null,
            },
            params:{
                type:Object,
                default(){
                    return{}
                }
            }
        },
        methods:{
            curretChange(pageIndex=1){
              this.$store.dispatch(this.actionName,{
                  ...this.params,
                  ...{
                      pageIndex
                  }
              })
          }
        },
        mounted() {
            this.curretChange();
        },
    }
</script>

<style scoped>

</style>